From ed30e62cc892bc381477b44c4eb50ce43a63f639 Mon Sep 17 00:00:00 2001 From: justbur Date: Wed, 22 Jul 2015 16:10:31 -0400 Subject: [PATCH] Simplify show page a little --- which-key.el | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/which-key.el b/which-key.el index cc98e2e7cdb..bff977b0896 100644 --- a/which-key.el +++ b/which-key.el @@ -947,8 +947,9 @@ enough space based on your settings and frame size." prefix-keys) (dash-w-face (propertize "-" 'face 'which-key-key-face)) (status-left (propertize (format "%s/%s" (1+ i) n-pages) 'face 'font-lock-comment-face)) - (status-top (propertize (format "(%s of %s)" (1+ i) n-pages) - 'face 'font-lock-comment-face)) + (status-top (when (< 1 n-pages) + (propertize (format "(%s of %s)" (1+ i) n-pages) + 'face 'font-lock-comment-face))) (first-col-width (+ 2 (max (string-width prefix-w-face) (string-width status-left)))) (prefix-left (s-pad-right first-col-width " " prefix-w-face)) @@ -967,16 +968,11 @@ enough space based on your settings and frame size." prefix-keys) first (concat prefix-left (car lines) "\n" (s-repeat first-col-width " ")) new-end (concat "\n" (s-repeat first-col-width " ")) page (concat first (mapconcat #'identity (cdr lines) new-end))))) - ((and (< 1 n-pages) - (eq which-key-show-prefix 'top)) - (setq page (concat prefix-w-face dash-w-face " " status-top "\n" page))) ((eq which-key-show-prefix 'top) - (setq page (concat prefix-w-face dash-w-face " \n" page))) - ((and (< 1 n-pages) - (eq which-key-show-prefix 'echo)) - (let (message-log-max) (message "%s" (concat prefix-w-face dash-w-face " " status-top)))) + (setq page (concat prefix-w-face dash-w-face " " status-top "\n" page))) ((eq which-key-show-prefix 'echo) - (let (message-log-max) (message "%s" (concat prefix-w-face dash-w-face " "))))) + (let (message-log-max) + (message "%s" (concat prefix-w-face dash-w-face " " status-top))))) (which-key--lighter-status n-shown n-tot) (if (eq which-key-popup-type 'minibuffer) (let (message-log-max) (message "%s" page)) -- 2.30.2